]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
[runDialog] Don't add duplicates to the history
authorAdel Gadllah <adel.gadllah@gmail.com>
Tue, 23 Mar 2010 19:22:46 +0000 (20:22 +0100)
committerAdel Gadllah <adel.gadllah@gmail.com>
Tue, 23 Mar 2010 19:22:46 +0000 (20:22 +0100)
When the user runs the same command as the last one saved there
is no need to save it again, otherwise we the history might end
up having lots of dupes which makes searching for an old command
harder.

https://bugzilla.gnome.org/show_bug.cgi?id=613731

js/ui/runDialog.js

index 403e6df6f94f07ea9d45a6b5fbf2d848f05b1a41..ca2fb262e473ae35182e8c35beeab58b6cea09fe 100644 (file)
@@ -330,8 +330,10 @@ RunDialog.prototype = {
     _run : function(input, inTerminal) {
         let command = input;
 
-        this._history.push(input);
-        this._saveHistory();
+        if (this._history.length > 0 && this._history[this._history.length - 1] != input) {
+            this._history.push(input);
+            this._saveHistory();
+        }
 
         this._commandError = false;
         let f;